import json

from core.api_util import api_util
from utils.log_util import logger
from utils.response_util import process_response

"""
优化：
r = requests.get(url, params={"shouji": param['shouji'], "appkey": param['appkey']})
print(r.status_code)
assert r.status_code == 200
"""

def mobile_query(params):

    response = api_util.get_mobile_belong(params=params)
    result = process_response(response)

    return result

def mobile_query_json(json_data):
    """
    这个方法用于测试json传参
    :param json_data:
    :return:
    """
    response = api_util.post_mobile_belong(json = json_data)
    logger.info("\n接口的返回内容>>>\n{}".format(json.dumps(response.json(), indent=2)))
    return response.json()

